package crack.ch1;

/**
 * @author Pavel Belevich
 *         Date: 6/16/12
 *         Time: 10:52 PM
 */
public class Problem2 {

    static char[] reverse(char[] str) {
        for (int i = 0 ; i < str.length / 2 ; i++) {
            char tmp = str[i];
            str[i] = str[str.length - i - 1];
            str[str.length - i - 1] = tmp;
        }
        return str;
    }

    public static void main(String[] args) {
        System.out.println(reverse("abcdefg".toCharArray()));
    }

}
